package edu.ccut.saturn.basecomponent.baseservicecomponent;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IDictItemInfo;
import edu.ccut.saturn.component.IParameterContext;
import edu.ccut.saturn.component.SaturnDictionaryManager;

public class UpdateRunTimeDict extends DefaultComponent {
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		String dictname = (String)parameterContext.getParameterValue(0);//"qx_usertype";
		String old_dictcode= (String)parameterContext.getParameterValue(1);
		String new_dictcode = (String)parameterContext.getParameterValue(2);
		String new_dictvalue = (String)parameterContext.getParameterValue(3);
		String py = (String)parameterContext.getParameterValue(4);
		IDictItemInfo item = SaturnDictionaryManager.getInstance().getDataDictItemInfo(dictname, old_dictcode);
		item.setValue(new_dictvalue);
		item.setCode(new_dictcode);
		item.setPinyin(py);
	}
}